<?php
include_once "db.php";
include_once "checksession.php"; 
$browsers = mysql_query("select * from browser_type");
$computer = mysql_query("select * from computer_type");
$problem = mysql_query("select * from problem_type");
$os = mysql_query("select * from operating_system");




 if($_GET[MyName] == "error") {
   print "* ";
  }?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Add a new Entry</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="meta-style.css" rel="stylesheet" type="text/css" />

<style type="text/css">
<!--
.style1 {
	color: #FFFFFF;
	font-weight: bold;
}
-->
</style>
</head>

<body>

<?php
include_once "topnav.php";
?>

<FORM action="insert_call.php" METHOD="POST">
	<input type="hidden" name="HDuserID" value="<? echo $_SESSION[ID] ?>">
<?
 if ($_GET[error]) {
  if($_GET[f_name] == "error") {
   print "<p class='error'>Please enter your First Name.</p>";
  }
  if($_GET[l_name] == "error") {
   print "<p class='error'>Please enter your Last Name.</p>";
  } 
    if($_GET[email] == "error") {
   print "<p class='error'>Please enter your Email.</p>";
  }
    if($_GET[Platform] == "error") {
   print "<p class='error'>Please select your Computer Type.</p>";
  }
    if($_GET[browser] == "error") {
   print "<p class='error'>Please enter your Browser.</p>";
  }
  if($_GET[operating_system] == "error") {
   print "<p class='error'>Please enter your Operating System.</p>";
  } 
    if($_GET[course] == "error") {
   print "<p class='error'>Please enter your Course.</p>";
  }
    if($_GET[problem_type] == "error") {
   print "<p class='error'>Please select your Problem Type.</p>";
  }
 }
?>
   <table width="800" BORDER=1 cellpadding=5 cellspacing=0 bordercolor="#006699" background="#CCCCCC" >
    <tr align="left" valign="top">
      <td colspan="2" bordercolor="#006699" bgcolor="#006699"><font color="white"><span class="style1">Add a New Helpdesk Entry</span></td>
    </tr>
	<tr>
	<td colspan="2"><font color="red">* = Required</font></td>
	</tr>
    <tr valign="top">
      <td width="50%" align="right" class="normalblue"><b><font color="#FF0000">*</font>First Name</b></td>
      <td width="50%" align="left"><input name="f_name" type="TEXT" id="f_name" value="<? if($_GET[f_name] != "error") print $_GET[f_name];?>" size="35"></td>
    </tr>
    <tr valign="top">
      <td width="50%" align="right" class="normalblue"><b><font color="#FF0000">*</font>Last Name</b></td>
      <td width="50%" align="left"><input name="l_name" type="TEXT" id="l_name" value="<? if($_GET[l_name] != "error") print $_GET[l_name];?>" size="35"></td>
    </tr>
    <tr valign="top">
      <td align="right" class="normalblue"><b><font color="#FF0000">*</font>UserID</b></td>
      <td align="left"><input name="userid" type="TEXT" id="userid" value="" size="35"></td>
    </tr>
     <tr valign="top">
       <td width="50%" align="right" class="normalblue"><b>Other Names used (old last name)</b></td>
       <td width="50%" align="left"><input name="o_name" type="TEXT" id="o_name" value="" size="35"></td>
     </tr>
     <tr valign="top">
       <td width="50%" align="right" class="normalblue"><b><font color="#FF0000">*</font>Return Email Address</b></td>
       <td width="50%" align="left"><input name="email" type="TEXT" id="email" value="<? if($_GET[email] != "error") print $_GET[email];?>" size="35"></td>
     </tr>
     <tr valign="top">
       <td align="right" class="normalblue"><b>Daytime Phone</b></td>
       <td align="left"><input name="dayphone" type="TEXT" id="dayphone" value="" size=35></td>
     </tr>
     <tr valign="top">
       <td align="right" class="normalblue"><b>Computer Type</b></td>
       <td align="left"><select name="Platform" size=1>
           <option selected>Select your computer...</option>
           <?php
		 while($computerresults = mysql_fetch_array($computer)) {
		 echo "<option value=\"".$computerresults[CT_ID]."\">".$computerresults[CT_desc]. "</option>\n";
	      }
	     ?>
       </select></td>
     </tr>
     <tr valign="top">
       <td align="right" class="normalblue"><b>Browser Type</b></td>
       <td align="left"><select  name="browser" size=1 id="browser">
           <option selected>Select a Browser...</option>
           <?php
		 while($browsersresults = mysql_fetch_array($browsers)) {
		 echo "<option value=\"".$browsersresults[BT_ID]."\">".$browsersresults[BT_desc]. "</option>\n";
	      }
	     ?>
       </select></td>
     </tr>
     <tr valign="top">
       <td width="50%" align="right" class="normalblue"><b>Problem or Question Category</b></td>
       <td width="50%" align="left"><select  name="problem_type" size=1 id="problem_type" value="<? if($_GET[problem_type] != "error") print $_GET[problem_type];?>">
         <option value="">Select your problem type...</option>
         <?php
		 while($problemresults = mysql_fetch_array($problem)) {
		 echo "<option value=\"".$problemresults[PT_ID]."\">".$problemresults[PT_desc]. "</option>\n";
	      }
	     ?>
       </select></td>
     </tr>
     <tr valign="top">
       <td width="50%" align="right" class="normalblue"><b>Operating System</b></td>
       <td width="50%" align="left"><select  name="operating_system" size=1 id="operating_system">
         <option value="">Select your Operating System</option>
         <?php
		 while($osresults = mysql_fetch_array($os)) {
		 echo "<option value=\"".$osresults[os_id]."\">".$osresults[os_desc]. "</option>\n";
	      }
	     ?>
       </select></td>
     </tr>
					
					
					
    <tr valign="top">
      <td width="50%" align="right" class="normalblue"><b>Course</b></td>
      <td width="50%" align="left">
						<?php
						   include_once "db.php";
									// ********* active semester list ********** //
						   $semester = mysql_query("select DISTINCT semester from current_courses ORDER BY semester");									
									while ($each_semester = mysql_fetch_object($semester))	{
											 echo "<b>".$each_semester->semester."</b>&nbsp;&nbsp;";
												
												
												$courses = mysql_query('SELECT * FROM current_courses WHERE semester='.$each_semester->semester.'');
												// ********* the course dropdown ********** //
												echo '<select name="Course"><option><b>Select a Course:</b></option>';
												while ($coursedropdown = mysql_fetch_object($courses))	{
															echo '<option value="'.$coursedropdown->ID.'"';
															/*
															if (defined('TypeID') && TypeID == $coursedropdown->ID) {
																		echo ' selected';
															}
															*/
												   echo '>'.$coursedropdown->course_title.'</option>';
												}	
												echo '</select><br><br>';
												
																								 
									}
									
	       // $semesterresults = mysql_fetch_assoc($semester);
		  // echo "<b>" .$semesterresults." semester</b>";
		  //$courses = mysql_query("select * from current_courses where semester = &value");
		  //echo "<select  name=course size=1 id=course><option selected>Select your course" ;
		  //while($coursesresults = mysql_fetch_array($courses)) {
		 // echo "<option value=\"".$coursesresults[section]."\">" .$coursesresults[course_number]. "&nbsp" .$coursesresults[course_title]. "&nbsp" .$coursesresults[section]. "</option>\n";
	      // }
		  
	     ?>	
      </td>
    </tr>
				
				
				
    <tr valign="top">
      <td width="50%" align="right" class="normalblue"><strong><b><font color="#FF0000">*</font></b>Did you reset user's Pipeline account? </strong></td>
      <td width="50%" align="left"><input name="pipeline_reset" type="checkbox" id="pipeline_reset" value="2">
Yes
  <input name="pipeline_reset" type="checkbox" id="pipeline_reset" value="1">
No &nbsp;</td>
    </tr>
    <tr valign="top">
      <td width="50%" align="right" class="normalblue"><b><font color="#FF0000">*</font>Enter call/email problem details here.</b></td>
      <td width="50%" align="left"><span class="normalblue">
        <textarea name="Problem" rows=5 cols=40 wrap="soft"></textarea>
      </span></td>
    </tr>
     <tr valign="top">
       <td width="50%" align="right" class="normalblue"><strong><b><font color="#FF0000">*</font></b>Call Closed?</strong> </td>
	  <td width="50%" align="left" class="normalblue"><input name="call_closed" type="radio" value="2">
Yes
<input name="call_closed" type="radio" value="1" >
No</td>
     </tr>
     <tr valign="top">
       <td width="50%" align="right" class="normalblue"><b>Did student call the online help desk and leave a message about
         this?</b></td>
       <td width="50%" align="left"><input name="call" type="checkbox" value="1">
         Yes
         <input name="call2" type="checkbox" value="2">
         No &nbsp;</td>
     </tr>
     <tr valign="top">
       <td width="50%" align="right"><span class="normalblue"><strong><b><font color="#FF0000">*</font></b>Did you reset user's Vista account?</strong></span></td>
       <td width="50%" align="left"><input name="vista_reset" type="checkbox" id="vista_reset" value="2">
         Yes
         <input name="vista_reset" type="checkbox" id="vista_reset" value="1">
         No &nbsp;</td>
     </tr>
     <tr valign="top">
       <td width="50%" align="right" class="normalblue"><p><strong><b><font color="#FF0000">*</font></b>Enter resolution information here: </strong></p></td>
       <td width="50%" align="left"><span class="normalblue">
         <textarea name="notes" cols=40 rows=5 wrap="soft" id="notes"></textarea>
       </span></td>
     </tr>
     <tr valign="top">
       <td width="50%" align="right" class="normalblue">&nbsp;</td>
       <td width="50%" align="left"><span class="normalblue">
         <input type=SUBMIT value="Submit Call" name="SUBMIT">
       </span></td>
     </tr>
  </table>
</FORM>

   
</body>
</html>
